home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC & Mediji 1998 February
/
PCM_9802.iso
/
programi
/
director
/
data.z
/
Simple Child Object.dir
/
00003_Script_Ball Parent Script
< prev
next >
Wrap
Text File
|
1997-05-10
|
759b
|
30 lines
property HorizPos
on new me
-- when the sprite is created, it's placed on the stage
set the horizPos of me to 200
set the locH of sprite 2 to the horizPos of me
set the locV of sprite 2 to 120
return me
end new
on moveBall me, direction
set the horizPos of me to direction * 50 + the horizPos of me
set stageWidth to the stageRight - the stageLeft
-- when more than half of the sprite has passed off stage,
-- it is made to appear on the opposite end of the stage
if the horizPos of me > (stageWidth + 99) then
set the horizPos of me to 0
end if
if the horizPos of me < -99 then
set the horizPos of me to stageWidth
end if
set the locH of sprite 2 to horizPos
end moveBall